package midend.IR_Type;

//尝试使用常量优化的方法类
public class IR_Const{
    public IR_Const(){
    }

    public static final String RET = "ret";
    public static final String LOAD = "load";
    public static final String ADD = "add";
    public static final String SUB = "sub";
    public static final String MUL = "mul";
    public static final String FADD = "fadd";
    public static final String FSUB = "fsub";
    public static final String FMUL = "fmul";
    public static final String FDIV = "fdiv";
    public static final String SDIV = "sdiv";
    public static final String SREM = "srem";
    public static final String SHL = "shl";
    public static final String LSHR = "lshr";
    public static final String ASHR = "ashr";
    public static final String XOR = "xor";
    public static final String cAND = "and";
    public static final String ZEXT = "zext";
    public static final String ALLOCA = "alloca";
    public static final String STORE = "store";
    public static final String GLOBAL = "global";
    public static final String LOCAL = "private unnamed_addr constant";

    public static final String BR = "br";
    public static final String ICMP = "icmp";
    public static final String FCMP = "fcmp";
    public static final String GETPTR = "getelementptr";
    public static final String CALL = "call";

    public static final int IR_ConstVoid = 0;
    public static final int IR_ConstInt1 = 1;
    public static final int IR_ConstInt32 = 2;
    public static final int IR_ConstFloat = 3;
    public static final int IR_ConstArray = 4;
    public static final int IR_ConstPointer = 5;
    public static final int IR_ConstFunction = 6;
    public static final int IR_BasicBlock = 7;
    public static final int IR_Instruction = 8;
    public static final int IR_GlobalVariable = 9;


    public static final int IntToFloat = 0;
    public static final int FloatToInt = 1;
    public static final int BITCAST = 2;

    public static final String[] int_Compare = {
            "eq", "ne", "sgt", "sge", "slt", "sle"
    };

    public static final String[] float_Compare = {
            "ueq","une", "ugt", "uge", "ult", "ule"
    };

    public static final int IR_EQ = 0;
    public static final int IR_NE = 1;
    public static final int IR_GT = 2;
    public static final int IR_GEQ = 3;
    public static final int IR_LT = 4;
    public static final int IR_LEQ = 5;

    public static final int IR_UEQ = 6;
    public static final int IR_UNE = 7;
    public static final int IR_UGT = 8;
    public static final int IR_UGE = 9;
    public static final int IR_ULT = 10;
    public static final int IR_ULE = 11;

    public static final String EQ = "==";
    public static final String NE = "!=";
    public static final String GT = ">";
    public static final String LT = "<";
    public static final String GEQ = ">=";
    public static final String LEQ = "<=";
    public static final String AND = "&&";
    public static final String OR = "||";
}
